home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Movie / Include / CMovie.h next >
Encoding:
Text File  |  1995-11-08  |  3.7 KB  |  132 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                CMovie.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Lonnie Millett
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef CMOVIE_H
  13. #define CMOVIE_H
  14.  
  15. #ifndef FWSTDDEF_H
  16. #include "FWStdDef.h"
  17. #endif
  18.  
  19. #ifndef FWGRDEF_H
  20. #include "FWGrDef.h"
  21. #endif
  22.  
  23. #ifndef _ODTYPESF_
  24. #include <ODTypesF.h>
  25. #endif
  26.  
  27. #if defined(FW_BUILD_MAC) && !defined(__MOVIES__)
  28. #include <Movies.h>
  29. #endif
  30.  
  31. //----------------------------------------------------------------------------------------
  32. //    Forward declarations
  33. //----------------------------------------------------------------------------------------
  34.  
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma import on
  37. #endif
  38. class FW_CLASS_ATTR FW_CRect;
  39. class FW_CLASS_ATTR FW_CFileSpecification;
  40. class FW_CLASS_ATTR FW_CMouseEvent;
  41. class FW_CLASS_ATTR FW_CVirtualKeyEvent;
  42. #if FW_LIB_EXPORT_PRAGMAS
  43. #pragma import off
  44. #endif
  45.  
  46. class FW_CLASS_ATTR CMovie FW_AUTO_DESTRUCT_OBJECT
  47. {
  48. public:
  49.     CMovie();
  50.     CMovie(Movie theAdoptedMovie);
  51.     CMovie(const CMovie& other);
  52.     virtual ~CMovie();
  53.     
  54.     CMovie&        operator=(const CMovie& other);
  55.     operator Movie();
  56.     
  57.     void MakeControllerVisible(FW_Boolean visible);
  58.  
  59.     void GetBoundingBox(FW_CRect& boundingBox);
  60.     void SetBoundingBox(const FW_CRect& boundingBox);
  61.     void SetGraphicsWorld(ODPlatformWindow platformWindow);
  62.     void SetClipShape(ODRgnHandle clipRegion);
  63.     
  64.     void Draw(ODPlatformWindow platformWindow);
  65.     
  66.     void Idle();
  67.     FW_Boolean DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  68.     FW_Boolean DoVirtualKeyDown(Environment* ev, const FW_CVirtualKeyEvent& theVirtualKeyEvent);
  69.  
  70.     void Activate(ODPlatformWindow platformWindow, FW_Boolean activate);
  71.     void Start();
  72.     void Stop();
  73.     
  74.     void SetLooping(FW_Boolean loop);
  75.     void EnableKeys(FW_Boolean enabled);
  76.     void EnableEditing(FW_Boolean enabled);
  77.     void EnableDragging(FW_Boolean enabled);
  78.     
  79.     FW_Boolean IsLooping();
  80.     FW_Boolean AreKeysEnabled();
  81.     FW_Boolean IsEditingEnabled();
  82.     FW_Boolean IsDragEnabled();
  83.     FW_Boolean IsPlaying();
  84.  
  85.     void GetCurrentSelection(TimeValue* currentTime, TimeValue* duration) const;
  86.     void SetCurrentSelection(TimeValue currentTime, TimeValue duration);
  87.     void ClearCurrentSelection();
  88.     void ClearSelection(TimeValue currentTime, TimeValue duration);
  89.     void CloseSelection();
  90.     FW_Boolean IsSelectionEmpty();
  91.     void SelectAll();
  92.     Movie CopySelection();
  93.     FW_PlatformHandle CopyCurrentSelectionToHandle();
  94.     
  95.     FW_PlatformHandle GetAsHandle();
  96.     FW_PlatformPict GetAsPict();
  97.     
  98.     void PasteMovieToSelection(CMovie* newMovie, TimeValue currentTime, TimeValue duration);
  99.     void PasteMovieToCurrentSelection(CMovie* newMovie);
  100.     void PasteHandleToSelection(FW_PlatformHandle newHandle, OSType handleType, TimeValue currentTime, TimeValue duration);
  101.     void PasteHandleToCurrentSelection(FW_PlatformHandle newHandle, OSType handleType);
  102.  
  103.     // Static methods
  104.     static FW_Boolean InitializeQuickTime();
  105.     static void TerminateQuickTime();
  106.     
  107.     // Factory methods
  108.     static CMovie* CreateNewMovieFromFile(const FW_CFileSpecification& movieFile);
  109.     static CMovie* CreateNewMovieFromHandle(FW_PlatformHandle movieHandle);
  110.     
  111. private:
  112.     Movie fMovie;
  113.     MovieController fMovieController;
  114. };
  115.  
  116. //========================================================================================
  117. //    Inlines
  118. //========================================================================================
  119.  
  120. //----------------------------------------------------------------------------------------
  121. //    CMovie::operator Movie
  122. //----------------------------------------------------------------------------------------
  123. inline CMovie::operator Movie()
  124. {
  125.     return fMovie;
  126. }
  127.  
  128.  
  129. #endif
  130.  
  131.  
  132.